﻿#region Imports
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;
#endregion

namespace CheckerWin.Utils
{
    public class MyContentAlignment
    {
        public enum eContentAlignment
        {
            // Summary:
            //     Content is vertically aligned at the top, and horizontally aligned on the
            //     left.
            TopLeft = ContentAlignment.TopLeft, // 1
            //
            // Summary:
            //     Content is vertically aligned at the top, and horizontally aligned at the
            //     center.
            TopCenter = ContentAlignment.TopCenter, // 2
            //
            // Summary:
            //     Content is vertically aligned at the top, and horizontally aligned on the
            //     right.
            TopRight = ContentAlignment.TopRight, // 4
            //
            // Summary:
            //     Content is vertically aligned in the middle, and horizontally aligned on
            //     the left.
            MiddleLeft = ContentAlignment.MiddleLeft, // 16
            //
            // Summary:
            //     Content is vertically aligned in the middle, and horizontally aligned at
            //     the center.
            MiddleCenter = ContentAlignment.MiddleCenter, // 32
            //
            // Summary:
            //     Content is vertically aligned in the middle, and horizontally aligned on
            //     the right.
            MiddleRight = ContentAlignment.MiddleRight, // 64
            //
            // Summary:
            //     Content is vertically aligned at the bottom, and horizontally aligned on
            //     the left.
            BottomLeft = ContentAlignment.BottomLeft, // 256
            //
            // Summary:
            //     Content is vertically aligned at the bottom, and horizontally aligned at
            //     the center.
            BottomCenter = ContentAlignment.BottomCenter, //512,
            //
            // Summary:
            //     Content is vertically aligned at the bottom, and horizontally aligned on
            //     the right.
            BottomRight = ContentAlignment.BottomRight // 1024,
        }

        #region Operators
        /// <summary>
        /// Evaluates the opposite value (horizontally) to the specified value
        /// </summary>
        /// <param name="a">Specified value to be evaluated against</param>
        /// <returns>Value opposite (horizontally) to the specified value</returns>
        /// <seealso cref="http://msdn.microsoft.com/en-us/library/8edha89s.aspx" />
        public static eContentAlignment operator !(eContentAlignment a)
        {
            eContentAlignment cont = eContentAlignment.MiddleCenter;

            // Top
            if (cont == eContentAlignment.TopLeft) return eContentAlignment.TopRight;
            else if (cont == eContentAlignment.TopRight) return eContentAlignment.TopLeft;
            // Middle
            else if (cont == eContentAlignment.MiddleLeft) return eContentAlignment.MiddleRight;
            else if (cont == eContentAlignment.MiddleRight) return eContentAlignment.MiddleLeft;
            // Right
            else if (cont == eContentAlignment.BottomLeft) return eContentAlignment.BottomRight;
            else if (cont == eContentAlignment.BottomRight) return eContentAlignment.BottomLeft;

            return cont;
        }
        #endregion
    }
}
